home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / MiniExamples / TIFFandEPS / PopAndForm.m < prev    next >
Encoding:
Text File  |  1992-12-19  |  788 b   |  35 lines

  1. /* PopAndForm.m
  2.  *  Purpose: A small Object that controls a Popup connected to a Form
  3.  *
  4.  *  You may freely copy, distribute, and reuse the code in this example.
  5.  *  NeXT disclaims any warranty of any kind, expressed or  implied, as to its
  6.  *  fitness for any particular use.
  7.  *
  8.  */
  9. #import <appkit/PopUpList.h>
  10. #import <appkit/FormCell.h>
  11. #import <appkit/Form.h>
  12. #import "PopAndForm.h"
  13.  
  14. @implementation PopAndForm
  15.  
  16. - newValue:sender
  17. {
  18.     char *enteredValue = (char *)[formcell stringValue];
  19.     if  ([[popup target] indexOfItem:enteredValue] == -1)
  20.     [[popup target] addItem:enteredValue];
  21.     [popup setTitle:enteredValue];
  22.     [formcell setEnabled:NO];        
  23.     return self;
  24. }
  25.  
  26. - enableForm:sender
  27. {
  28.     [formcell setEnabled:YES];
  29.     [formcell selectTextAt:0];
  30.     return self;
  31. }
  32.  
  33.  
  34. @end
  35.